package ControlLayer;
import java.util.ArrayList;

import ModelLayer.*;


// The controller for ALL persons in the system: Customers, Employees and Business Customers;
//
public class PersonCtr
{
    private Person PersonCon;
    private ArrayList<BusinessCustomer> businessCon;

    public PersonCtr()
    {
        PersonCon = PersonCon.getInstance();
    }

    // Create new person
    //
    public void createPerson(int id, String name, String address, String phone, String mail, String CPRnr) {
        
    	if((PersonCon).getPerson(id) == null)
        {
            Customer newCustomer = new Customer(id, name, address, phone, mail, CPRnr);
            customerCon.addCustomer(newCustomer);
        }
        else
        {
            System.out.println("There already exists a customer with id: "+id+" in the system");
        }
    }